var el=document.getElementById("<?php echo $_GET['el'] ?>"),
  p="<?php echo(isset($_GET['p'])?$_GET['p']:'') ?>",
  w=p.split(';'),wc=w.length,wi,wdef;

for(wi=0;wi<wc;++wi){
  if(w[wi].substr(0,1)=='?'){ el.label=w[wi].substr(1); }
  else if(w[wi].substr(0,1)=='@'){
    <?php include'_events.php' ?>
  }
  else if(w[wi].substr(0,1)=='!'){
  }
  else if(w[wi].substr(0,1)=='_'){
  }
  else{
  }
}

var s=el.style;
el.txt=document.createElement("input");
el.txt.parent=el;
el.txt.drag=false;
el.appendChild(el.txt);

el.txt.addEventListener("mousedown",function(e){
    var t=e.target;
    t.drag=true;
    t.x=e.pageX-t.offsetLeft; t.y=e.pageY-t.offsetTop;
    t.value=t.x;
},false);

el.txt.addEventListener("mousemove",function(e){
    if(e.target.drag==true){
        var t=e.target;
        t.x=e.pageX-t.parent.offsetLeft; //t.y=e.pageY-t.parent.offsetTop;
        t.value=t.x+":"+t.parent.offsetLeft;
        t.style.marginLeft=(t.x-t.offsetLeft)+"px";
        
    }
},false);

el.txt.addEventListener("mouseover",function(e){ e.target.drag=(e.target.drag==true?true:false); },false);
el.txt.addEventListener("mouseout",function(e){ e.target.drag=false; },false);
el.txt.addEventListener("mouseup",function(e){ e.target.drag=false; },false);

s.background="red";
